package sort;



import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public final class Test {
    static class Helper {
        int val;

        public Helper(int val) {
            this.val = val;
        }

        @Override
        public String toString() {
            return String.valueOf(val);
        }
    }
    public static void main(String[] args) {
        List<Helper> list = new ArrayList<Helper>();
        list.add(new Helper(22));
        list.add(new Helper(23));
        list.set(0, new Helper(25));
        List<Helper> UL = Collections.unmodifiableList(list);
//        UL.set(0, new Helper(3)); // this is not allowed
        UL.get(0).val = 2;
        System.out.println(UL);
        System.out.println(list);
    }
}
